import { Tools } from 'weaver-mobile';

// 获取门户数据
export const getHomepageData = (params = {}) => {
  const url = '/api/mobile/portal/elements/elementJson';
  const method = 'GET';
  params.__random__ = Date.now();
  return Tools.callApi({ url, method, params, type: 'json' });
};

// 获取元素数据
export const getElementData = (params = {}) => {
  const url = '/api/mobile/portal/elements/tab';
  const method = 'GET';
  params.__random__ = Date.now();
  return Tools.callApi({ url, method, params, type: 'json' });
};

// 获取流程中心元素数据
export const getWorkflowData = (params = {}) => {
  const url = '/api/portal/element/workflowtab';
  const method = 'POST';
  params.__random__ = Date.now();
  return Tools.callApi({ url, method, params, type: 'json' });
};

// 获取文档中心元素数据
export const getDocData = (params = {}) => {
  const url = '/api/portal/element/newstab';
  const method = 'POST';
  params.__random__ = Date.now();
  return Tools.callApi({ url, method, params, type: 'json' });
};
